package cn.tedu.basic;

/**
 * @author ：Dsi
 * @date ：2021/11/20 10:14
 * Describe ：
 */
public class TestTypeChange {
    public static void main(String[] args) {
        byte a = 10;
        short b = a;

        int c = 1;
        long d = c;

        float f = 3.14f;
        double e = f;

        long g = 156461436546L;
        float h = g;

        char i = 'a';
        int j = i;
        System.out.println(j);//97

        int a1=1;
        byte b1=2;
        //byte c1=a1+b1;//会报错，大转小
        byte c1 = (byte) (a1 + b1);//强制转换

        short e1='a';
        char f1=127;
        System.out.println(e1);
        System.out.println(f1);

        float f3=455.465F;
//        int g3=f3;//报错，不能小转大
        int g3=(int)f3;//强制转，小数点舍弃
        System.out.println(g3);







    }
}
